package com.qf.controller;

import com.qf.dao.StoreInfoRepository;
import com.qf.pojo.entity.StoreInfo;
import com.qf.pojo.resp.BaseResp;
import com.qf.service.StoreInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @ClassName SotreInfoController
 * @Description TODO
 * @Author Windy
 * @Date 2022/10/6 13:29
 * @Version 1.0
 **/
@RestController
@RequestMapping("store")
@Api(tags = "店铺信息")
public class StoreInfoController {
    @Autowired
    StoreInfoService storeInfoService;

    @GetMapping("findInfo")
    @ApiOperation(value = "通过店铺id获取店铺的信息")
    public BaseResp findStoreInfo(int storeId){
        return storeInfoService.findStoreInfo(storeId);
    }

    @PostMapping("upSave")
    @ApiOperation(value = "更改店铺的基本信息")
    public BaseResp saveStoreInfo(@RequestBody StoreInfo storeInfo){
        return  storeInfoService.upSave(storeInfo);
    }
}
